package com.software.sqlite.task;
import com.software.sqlite.service.impl.TaskService;
import com.software.sqlite.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Description
 * @ClassName ApiTask
 * @Author darren
 * @date 2023.04.07 15:23
 */
@Component
@EnableScheduling
@Slf4j
public class ShipDeviceLogTask {

    @Value("${task.shipDeviceLogData}")
    private boolean shipDeviceLogData;

    @Resource
    private TaskService taskService;

    public static boolean isRunning=false;

    //表示每天执行一次
//    @Scheduled(fixedRate =1*60*1000)
    private void scheduledTask() {
//        if(shipDeviceLogData){
//            log.info("shipDeviceLogData scheduledTask...");
//            Date now=new Date();
//            String logDate= DateUtils.format(DateUtils.dayOffset(now,-1),DateUtils.YMD_DASH);
//            taskService.autoShipDeviceLog(logDate);
//        }
    }

}
